<?php
/**
 * Dragons Fun copy
 * @author aanbek
 */
include_once 'inc/fnc.php';

$password = rand(1,999999);

  $usersCounter = $db->rows("SELECT COUNT (`id`) FROM `users`");
        $idNew = $usersCounter + 1;
        $regUserSql = "INSERT INTO `users` SET `login`=?,`password`=?";
        $passwordNewUs = rand(100000, 200000);
        $regUserPh = array("Guest", $passwordNewUs);
        $regUser = $db->query($regUserSql, $regUserPh);
        $_SESSION['id'] = $db->last();
        $_SESSION['password'] =& $passwordNewUs;
        header("Location:/");
        exit;

  